<template>
    <Modal title="批量分享好友" @on-visible-change="showModal" v-model="show" :closable="false" :mask-closable="false">
        <el-form ref="back" label-position="right" label-width="80px">
            <el-form-item label="好友ID" prop="cost">
                <el-input size="small" type="text" v-model="cost" placeholder="好友ID" style="width: 240px" />
            </el-form-item>
        </el-form>
        <div slot="footer">
            <el-button size="small" @click="cancel">取消</el-button>
            <el-button @click="getList" type="success" size="small" :loading="loading">确定分享</el-button>
        </div>
    </Modal>
</template>
<script>
export default {
    name: "CXiapiCost",
    data() {
        return {
            loading: false,
            cost: 0,
            show: false,
        }
    },
    props: [

    ],
    methods: {
        showModal: function(val) {

        },
        showDialog: function(ids) {
            this.ids = ids;
            this.show = true;
        },


        getList: function() {

            this.loading = true;
            this.$http.post("/storageproduct/submitShare.do", { productId: this.ids, userId: this.cost }).then(response => {
                this.loading = false;
                if (response.status == 0) {
                    this.$emit('ok');
                    this.show = false;
                } else {
                    this.errorMessage(response.info);
                }
            }, response => {
                this.errorMessage("系统异常");
                this.loading = false;
            });
        },

        cancel: function() {
            this.show = false;
            this.$emit('cancel')
        }

    }
}
</script>
<style scoped>
.ivu-alert-with-desc {
    padding: 0px 16px;
}

.time {
    font-size: 14px;
    font-weight: bold;
}

.content {
    padding-left: 5px;
    word-wrap: break-word;
}
</style>